<%@ page language="java" contentType="text/html; charset=GBK"
    pageEncoding="GBK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>user query list</title>
</head>

<script type="text/javascript">
	function setUserType(userCode,userName){
		var url = "<%=request.getContextPath() %>/login.do?method=queryUserTypes&userCode="+userCode+"&userName="+userName;
		window.open(url,"","height=500,width=600");
	}
</script>

<body>
	<form action="login.do" name="LoginForm" method="POST">
		<table width="100%" cellpadding="5" cellspacing="1" border="1" border="1">
			<tr>
				<td colspan="8" align="center"><B>user list</B></td>
			</tr>
			<tr>
				<td align="center"><B>user code</B></td>
				<td align="center"><B>user name</B></td>
				<td align="center"><B>password</B></td>
				<td align="center"><B>user sex</B></td>
				<td align="center"><B>user mobile telephone</B></td>
				<td align="center"><B>user status</B></td>
				<td align="center"><B>operation</B></td>
			</tr>
			<c:forEach items="${col}" var="one" varStatus="status">
				<tr>
					<td colspan="1">
						<c:choose>
							<c:when test="${one.userCode == 'admin'}">
								<input type="checkbox" name="boxes" value="${status.index }" disabled>
							</c:when>
							<c:otherwise>
								<input type="checkbox" name="boxes" value="${status.index }">
							</c:otherwise>
						</c:choose>
						&nbsp;${one.userCode}
						<input type="hidden" name="UserCode" value="${one.userCode}">
					</td>
					<td colspan="1">&nbsp;${one.userName}</td>
					<td colspan="1">&nbsp;${one.passWord}</td>
					<td colspan="1">&nbsp;${one.userSex}</td>
					<td colspan="1">&nbsp;${one.userMobile}</td>
					<td colspan="1">&nbsp;${one.validStatus}</td>
					<td colspan="1" align="center">
						<c:choose>
							<c:when test="${one.userCode == 'admin'}">
								<input type="button" name="but" value="permission" onclick="setUserType('${one.userCode}','${one.userName}')" disabled>
							</c:when>
							<c:otherwise>
								<input type="button" name="but" value="permission" onclick="setUserType('${one.userCode}','${one.userName}')">
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
			</c:forEach>
		</table>
		<jsp:include page="../util/SplitAndCRUDPage.jsp"></jsp:include>
	</form>
</body>
<script type="text/javascript">
	var fm = LoginForm;
</script>
</html>